package fr.mywiki.business.navigation;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import fr.mywiki.business.navigation.SpaceFlyweight;

/**
 * Test class for the functionalities of the SpaceFlyweight objects.
 * 
 * @see http://localhost:8080/MyWiki/ServletTestRunner?suite=fr.mywiki.business.manager.navigation.SpaceFlyweightTest&xsl=cactus-report.xsl
 */
public class SpaceFlyweightTest extends TestCase {
	static final String SPACE_NAME = "space name";
	static final String SPACE_TITLE = "space title";
	static final String SPACE_FORWARD = "space forward";

	public SpaceFlyweightTest(String a_name) {
		super(a_name);
	}

	public static Test suite() {
		TestSuite suite = new TestSuite();
		suite.addTestSuite(SpaceFlyweightTest.class);

		return suite;
	}
	
	/**
	 * Tests the constructor of SpaceFlyweight, checks if all the fields are
	 * correct.
	 */
	public void testNewSpaceFlyweight() {
		SpaceFlyweight space = new SpaceFlyweight(SPACE_NAME, SPACE_TITLE, SPACE_FORWARD);
		
		assertEquals(SPACE_NAME,space.getName());
		assertEquals(SPACE_TITLE,space.getTitle());
		assertEquals(SPACE_FORWARD,space.getStartForward());
	}
}
